<?php
class MY_Controller extends CI_Controller
{
	public function __construct(){
		parent::__construct();
		$this->chk_login();
	}
	/*
	 * 检查是否登录
	 */
	public function chk_login(){
		$this->load->helper('url');
		//$sess = $this->session->user_data();
		$sess = $this->session->all_userdata();
		if(isset($sess['username'])){
			//echo '已经登录';
		}else{
			redirect(site_url('sysadmin/login'), 'refresh');
		}
		
	}
	
}